{% extends "base.html" %}

{% block title %}Home - Archive Audit System{% endblock %}

{% block content %}
<div class="jumbotron">
    <h1 class="display-4">Welcome to the Archive Audit System</h1>
    <p class="lead">A comprehensive solution for archiving and auditing both structured and unstructured data with permission controls.</p>
    <hr class="my-4">
    <p>Use the navigation menu to access the system's features.</p>
</div>

<div class="row mt-5">
    <div class="col-md-4">
        <div class="card">
            <div class="card-header bg-primary text-white">
                <h5 class="card-title mb-0">Archive Process</h5>
            </div>
            <div class="card-body">
                <ul class="list-unstyled">
                    <li>✓ Archive structured databases (SQLite)</li>
                    <li>✓ Archive unstructured data (files and directories)</li>
                    <li>✓ Metadata tracking and indexing</li>
                    <li>✓ Hash-based integrity verification</li>
                </ul>
                <div class="d-grid gap-2">
                    <a href="{{ url_for('archive_db') }}" class="btn btn-outline-primary">Archive Database</a>
                    <a href="{{ url_for('archive_files') }}" class="btn btn-outline-primary">Archive Files</a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-4">
        <div class="card">
            <div class="card-header bg-success text-white">
                <h5 class="card-title mb-0">Audit Process</h5>
            </div>
            <div class="card-body">
                <ul class="list-unstyled">
                    <li>✓ Search data in archived databases with SQL queries</li>
                    <li>✓ Display results in formatted tables</li>
                    <li>✓ Browse and search unstructured data archives</li>
                    <li>✓ File metadata analysis</li>
                </ul>
                <div class="d-grid gap-2">
                    <a href="{{ url_for('list_db_archives') }}" class="btn btn-outline-success">Database Archives</a>
                    <a href="{{ url_for('list_file_archives') }}" class="btn btn-outline-success">File Archives</a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-4">
        <div class="card">
            <div class="card-header bg-info text-white">
                <h5 class="card-title mb-0">Search & Analysis</h5>
            </div>
            <div class="card-body">
                <ul class="list-unstyled">
                    <li>✓ Search across all archives</li>
                    <li>✓ Find specific files or data</li>
                    <li>✓ Analyze archive contents</li>
                    <li>✓ Export results</li>
                </ul>
                <div class="d-grid gap-2">
                    <a href="{{ url_for('search') }}" class="btn btn-outline-info">Search Archives</a>
                </div>
            </div>
        </div>
    </div>
</div>

{% if session.role == 'admin' %}
<div class="row mt-4">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header bg-warning">
                <h5 class="card-title mb-0">Administration</h5>
            </div>
            <div class="card-body">
                <p>As an administrator, you can manage users and their permissions.</p>
                <a href="{{ url_for('users') }}" class="btn btn-outline-warning">Manage Users</a>
            </div>
        </div>
    </div>
</div>
{% endif %}
{% endblock %}
